import React from 'react';

import render from '../../../../../hrpub/common/frame/render';

import OrgRefer from '../../../../../hrpub/common/components/referSearch/org';

import HeaderAction from './headerAction';

import './index.less'

import { base } from 'nc-lightapp-front';

let { NCSelect, NCRow, NCCol, NCCheckbox, NCButton, NCSwitch, NCMenu,NCItem, NCIcon } = base;

let NCOption = NCSelect.NCOption;

export default render({
    actions: {
        header: HeaderAction
    },
    state: {
        flag:true
    }
})(({props, action, state}) => {
    const { button } = props;
    let { createButtonApp } = button; 
    return (
        <header className="nc-bill-header-area">
            {props.appConfig.type === 'ORGANI' ? (
                <div className="search fl">
                {props.buttonDisableFlag === true?(
                     <OrgRefer
                     disabled = {!props.buttonFlag}
                     className="selectTrial"
                     getOrgData = {action.header.handleChangePeople}
                     orgVal={props.orgValue}
                 />
                ):null}
                   
                </div>
            ):null}
            
            <div className="search fl">
                <NCSelect
                    defaultValue="1"
                    disabled = {!props.buttonFlag}
                    className="selectTrial"
                    style={{ width: 200, marginRight: 6 }}
                    onChange={action.header.handleChange}
                >
                    {/* 入职试用 */}
                    <NCOption value="1">{props.json['gx6008-000020']}</NCOption>
                    {/* 转岗试用 */}
                    <NCOption value="2">{props.json['gx6008-000021']}</NCOption>
                </NCSelect>

            </div>

            <div className="fr">
                {props.dateFlag === true?(createButtonApp({area:'head_action',onButtonClick: action.header.buttonVisible})):null}
            </div>
        </header>
    );

});